#include "StdAfx.h"
using namespace System;
using namespace System::Text;
using namespace System::Collections::Generic;
using namespace Microsoft::VisualStudio::TestTools::UnitTesting;

#define TRACE
#include <System.cpu\cpuFalloc.h>

namespace Tests
{
	cpuFallocHost _fallocHost;

	[TestClass]
	public ref class FallocTest
	{
	public:
		TestContext^ Ctx;

		[TestInitialize()]
		void TestInitialize()
		{
			_fallocHost = cpuFallocInit(2048);
		}

		[TestCleanup()]
		void TestCleanup()
		{
			cpuFallocEnd(_fallocHost);
		}

		[TestMethod]
		void cpuFallocInit_Valid()
		{
			Assert::AreNotSame(nullptr, (int)_fallocHost.heap);
			Assert::AreNotSame(0, _fallocHost.length);
		}

		[TestMethod]
		void cpuFallocInit_Works()
		{
			fallocInit(_fallocHost.heap);
		}

		//[TestMethod]
		//void x()
		//{
		//	void* obj = fallocGetChunk(heap);
		//	fallocFreeChunk(heap, obj);
		//}
	};
}
